import { RequestHandler } from 'express';
import { req_info_cur_user_function_delete } from '../Classes/cla_req_info_cur_user_function_delete';
import { res_send_cur_user_functions_delete } from '../Classes/cla_res_send_cur_user_functions_delete';
import { sign_out_mdb_cur_user_function_identity } from '../Func/sign_out_mdb_cur_user_function_identity';
import { log_info_cur_user_function_delete } from '../Func/Log_info';
/**
 * 这个 返回 一个 组件列 的 模拟元素
 */
export const cur_user_delete_func: RequestHandler = async (req, res) => {
  let req_info = new req_info_cur_user_function_delete(req);

  let deleted_id_arr = await sign_out_mdb_cur_user_function_identity(req_info);

  /**
   * 修订 已删除 信息记录
   */
  req_info.delete_func_id_arr = deleted_id_arr;

  /**
   * log 日志 已删除 的 函数
   */
  log_info_cur_user_function_delete(req_info);

  /**
   * 响应 创建 函数 信息
   */
  let res_send = new res_send_cur_user_functions_delete(deleted_id_arr);

  res.send(res_send);
};
